<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/custom/custom/Base_DefectItem.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/Ware/Ware_Wares.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {
        const table = ref({
            key: 'WareId',
            footer: "Foots",
            cnName: '仓库管理',
            name: 'Ware/Ware_Wares',
            url: "/Ware_Wares/",
            sortName: "CreateDate"
        });
        const editFormFields = ref({ "WareCode": "", "WareName": "", "AreaId": "", "WareSqure": "", "LocationCode": "", "Creator": "", "WareState": "", "WareNote": "", "WareImg": "" });
        const editFormOptions = ref([[{ "title": "仓库编号", "field": "WareCode", "type": "text" }],
        [{ "title": "仓库名称", "required": true, "field": "WareName", "type": "text" }]
            , [{"dataKey":"Ware_WaresAreaId","data":[],"title":"仓库区域","field":"AreaId","type":"select"}]
            , [{ "title": "面积", "required": true, "field": "WareSqure", "type": "text" }]
            , [{ "title": "位置编码", "required": true, "field": "LocationCode", "type": "text" }]
            , [{ "title": "负责人", "field": "Creator", "type": "text" }]
            , [{ "dataKey": "Ware_WaresState", "data": [], "title": "状态", "field": "WareState", "type": "radio" }]
            , [{ "title": "备注", "field": "WareNote", "type": "textarea" }]
            , [{ "title": "图片", "field": "WareImg", "type": "img" }]]);
        const searchFormFields = ref({ "WareCode": "", "WareName": "", "AreaId": "", "WareSqure": "", "LocationCode": "", "Creator": "", "WareState": "", "WareNote": "", "WareImg": "" });
        const searchFormOptions = ref([[{ "title": "仓库编号", "field": "WareCode", "type": "like" }]
            , [{ "title": "仓库名称", "field": "WareName", "type": "like" }]
            , [{"dataKey":"Ware_WaresAreaId","data":[],"title":"仓库区域","field":"AreaId","type":"select"}]
            , [{ "title": "面积", "field": "WareSqure", "type": "like" }]
            , [{ "title": "位置编码", "field": "LocationCode", "type": "like" }]
            , [{ "title": "负责人", "field": "Creator", "type": "like" }]
            , [{ "dataKey": "Ware_WaresState", "data": [], "title": "状态", "field": "WareState", "type": "radio" }]
            , [{ "title": "备注", "field": "WareNote", "type": "like" }]
            , [{ "title": "图片", "field": "WareImg", "type": "like" }]]);
        const columns = ref([{ field: 'WareId', title: '仓库管理主键', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
        { field: 'WareCode', title: '仓库编号', type: 'string', sort: true, width: 180, align: 'left', sort: true },
        { field: 'WareName', title: '仓库名称', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'AreaId',title:'仓库区域',type:'string',bind:{ key:'Ware_WaresAreaId',data:[]},width:120,align:'left'},
        { field: 'WareSqure', title: '面积', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'LocationCode', title: '位置编码', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'Creator', title: '负责人', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'WareState', title: '状态', type: 'int', bind: { key: 'Ware_WaresState', data: [] }, width: 110, align: 'left' },
        { field: 'WareNote', title: '备注', type: 'string', link: true, sort: true, width: 180, require: true, align: 'left' },
        { field: 'WareImg', title: '图片', type: 'img', width: 220, align: 'left' }]);
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });
        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
